﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:myapp="clr-namespace:DataComparisons"
	mc:Ignorable="d"
	x:Class="Results"
	x:Name="UserControl"
	d:DesignWidth="640" d:DesignHeight="480" xmlns:Custom="http://schemas.microsoft.com/wpf/2008/toolkit">
	<UserControl.Resources>
      <myapp:CellHighlighterConverter x:Key="cellHighlighterConverter" />
	</UserControl.Resources>
	<Grid x:Name="LayoutRoot">
        <Custom:DataGrid ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Visible" CanUserAddRows="False" CanUserDeleteRows="False" IsReadOnly="True" AutoGenerateColumns="False" EnableColumnVirtualization="False" EnableRowVirtualization="True" VirtualizingStackPanel.VirtualizationMode="Recycling" CanUserSortColumns="False" FrozenColumnCount="0" SelectionUnit="Cell" SelectionMode="Extended" HorizontalAlignment="Stretch" Margin="5,100,4,5" VerticalAlignment="Stretch" Height="Auto" x:Name="dgResults" CanUserReorderColumns="False" GridLinesVisibility="All" VerticalGridLinesBrush="White" HorizontalGridLinesBrush="White" Background="#FFFFFFFF" BorderBrush="#55000000">
			<Custom:DataGrid.ContextMenu>
				<ContextMenu Background="White">
					<MenuItem Command="ApplicationCommands.Copy" />
				</ContextMenu>
			</Custom:DataGrid.ContextMenu>
			<Custom:DataGrid.CellStyle>
                <Style TargetType="{x:Type Custom:DataGridCell}">
                    <Style.Triggers>
                        <Trigger Property="IsSelected" Value="true">
                            <Setter Property="Background" Value="#dfd"/>
                        </Trigger>
                    </Style.Triggers>
                    <Setter Property="BorderThickness" Value="0"/>
                    <Setter Property="Background">
                        <Setter.Value>
                            <MultiBinding Converter="{StaticResource cellHighlighterConverter}" >
                                <MultiBinding.Bindings>
                                    <Binding RelativeSource="{RelativeSource Self}"/>
                                    <Binding Path="Row"/>
                                </MultiBinding.Bindings>
                            </MultiBinding>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Custom:DataGrid.CellStyle>
        </Custom:DataGrid>
        <myapp:IconBlueDB Margin="8,45,0,0" VerticalAlignment="Top" Height="45" Width="44" HorizontalAlignment="Left"/>
        <myapp:IconRedDB HorizontalAlignment="Left" Margin="8,5,0,0" VerticalAlignment="Top" Width="44" Height="45"/>
		<TextBlock Height="Auto" HorizontalAlignment="Left" Margin="60,10,0,0" Name="lblSqlServerA" VerticalAlignment="Top" Width="Auto" Text="{Binding Path=SqlServerNameA}" Foreground="#FFFF0000" FontWeight="Bold" />
		<TextBlock Height="Auto" HorizontalAlignment="Left" Margin="60,25,0,0" x:Name="lblDatabaseA" VerticalAlignment="Top" Width="Auto" FontWeight="Normal" Foreground="#FFFF0000" Text="{Binding Path=DatabaseAndTableNameA}" />
        <TextBlock Height="Auto" HorizontalAlignment="Left" Margin="60,50,0,0" Name="lblSqlServerB" VerticalAlignment="Top" Width="Auto" Text="{Binding Path=SqlServerNameB}" Foreground="#FF0000FF" FontWeight="Bold" />
        <TextBlock Height="Auto" HorizontalAlignment="Left" Margin="60,65,0,0" x:Name="lblDatabaseB" VerticalAlignment="Top" Width="Auto" FontWeight="Normal" Foreground="#FF0000FF" Text="{Binding Path=DatabaseAndTableNameB}" />
        <Button HorizontalAlignment="Right" Margin="0,73.566,8,0" VerticalAlignment="Top" Width="61.334" Height="22.434" Content="Refresh" x:Name="btnRefresh"/>
        <Label HorizontalAlignment="Right" Margin="0,75,80,0" VerticalAlignment="Top" Width="Auto" Height="Auto" x:Name="lblCount">
            <Label.Content>
                <PriorityBinding>
                    <Binding ElementName="UserControl" Path="DifferenceCount" IsAsync="False" />
                </PriorityBinding>
            </Label.Content>
        </Label>
        <myapp:Loading x:Name="ResultsLoading" HorizontalAlignment="Center" Margin="0,150,0,0" VerticalAlignment="Top" d:LayoutOverrides="Height" Visibility="Hidden" />
    </Grid>
</UserControl>